package com.yiyahui.project.erp.service.impl;

import java.util.List;
import com.yiyahui.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yiyahui.project.erp.mapper.YiyaDeductStepMapper;
import com.yiyahui.project.erp.domain.YiyaDeductStep;
import com.yiyahui.project.erp.service.IYiyaDeductStepService;

/**
 * 划扣步骤Service业务层处理
 * 
 * @author yiyahui
 * @date 2020-05-12
 */
@Service
public class YiyaDeductStepServiceImpl implements IYiyaDeductStepService 
{
    @Autowired
    private YiyaDeductStepMapper yiyaDeductStepMapper;

    /**
     * 查询划扣步骤
     * 
     * @param id 划扣步骤ID
     * @return 划扣步骤
     */
    @Override
    public YiyaDeductStep selectYiyaDeductStepById(Long id)
    {
        return yiyaDeductStepMapper.selectYiyaDeductStepById(id);
    }

    /**
     * 查询划扣步骤列表
     * 
     * @param yiyaDeductStep 划扣步骤
     * @return 划扣步骤
     */
    @Override
    public List<YiyaDeductStep> selectYiyaDeductStepList(YiyaDeductStep yiyaDeductStep)
    {
        return yiyaDeductStepMapper.selectYiyaDeductStepList(yiyaDeductStep);
    }

    /**
     * 新增划扣步骤
     * 
     * @param yiyaDeductStep 划扣步骤
     * @return 结果
     */
    @Override
    public int insertYiyaDeductStep(YiyaDeductStep yiyaDeductStep)
    {
        yiyaDeductStep.setCreateTime(DateUtils.getNowDate());
        return yiyaDeductStepMapper.insertYiyaDeductStep(yiyaDeductStep);
    }

    /**
     * 修改划扣步骤
     * 
     * @param yiyaDeductStep 划扣步骤
     * @return 结果
     */
    @Override
    public int updateYiyaDeductStep(YiyaDeductStep yiyaDeductStep)
    {
        yiyaDeductStep.setUpdateTime(DateUtils.getNowDate());
        return yiyaDeductStepMapper.updateYiyaDeductStep(yiyaDeductStep);
    }

    /**
     * 批量删除划扣步骤
     * 
     * @param ids 需要删除的划扣步骤ID
     * @return 结果
     */
    @Override
    public int deleteYiyaDeductStepByIds(Long[] ids)
    {
        return yiyaDeductStepMapper.deleteYiyaDeductStepByIds(ids);
    }

    /**
     * 删除划扣步骤信息
     * 
     * @param id 划扣步骤ID
     * @return 结果
     */
    @Override
    public int deleteYiyaDeductStepById(Long id)
    {
        return yiyaDeductStepMapper.deleteYiyaDeductStepById(id);
    }
}
